import http from '@/util/axios';

import type { ListParams } from './type';
// 统一管理接口
enum API {
  LIST = '/api/asset/owner/list',
  CREATE = '/api/asset/owner/create',
  DETAIL = '/api/asset/owner/detail',
  EDIT = '/api/asset/owner/edit',
  DELETE = '/api/asset/owner/delete',
  DOWNICON = '/api/asset/owner/download_icon'
}

/**
 * @method 获取列表
 */
// export const getSubjectList = (params: any) => http.get(API.LIST, { params });
export const getSubjectList = (params: any) => {
  return Promise.resolve({
    code: 200,
    message: '成功',
    page: 1,
    page_size: 10,
    total: 1,
    data: [
      {
        code: 'ZT10020240701140137',
        name: '上海有方事业集团',
        credit_code: '23047203942038XXS',
        created_time: '2024-07-01 14:01:37',
        address: '上海测试区',
        id: 1
      }
    ]
  });
};

/**
 * @method 创建主体
 */
export const createList = (params: ListParams) => http.post(API.CREATE, params);

/**
 * @method 查看
 */
export const detail = (params: any) => http.get(API.DETAIL, { params });

/**
 * @method 编辑
 */
export const editDetail = (params: any) => http.post(API.EDIT, params);

/**
 * @method 删除
 */
export const deleteData = (params: any) => http.get(API.DELETE, { params });

/**
 * @method 下载图标
 */
export const downIcon = (params: any) => http.get(API.DOWNICON, { params });
